package cn.picclife.mwx.manager.sys.controller;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.alibaba.fastjson.JSONObject;

import cn.picclife.mwx.manager.sys.model.bo.DataResponse;
import cn.picclife.mwx.manager.sys.model.bo.TipMessageListQueryReq;
import cn.picclife.mwx.manager.sys.model.bo.TipQueryReq;
import cn.picclife.mwx.manager.sys.model.bo.TipSaveReq;
import cn.picclife.mwx.manager.sys.model.bo.TipUpdateReq;
import cn.picclife.mwx.manager.sys.service.TipMessageService;

/**
 * @description 提示信息controller 
 * @author SaiZhiyi
 * @creatTime 2020年7月16日 上午10:50:15
 */
@RequestMapping("tipMessage")
@RestController
public class TipMessageController {
	private Log log = LogFactory.getLog(TipMessageController.class);

	@Autowired
	private TipMessageService tipMessageService;
	
	/**
	 * @description 查询提示信息列表 
	 * @author saizhiyi 
	 * @param req
	 * @return
	 */
	@RequestMapping(value="/queryList", method= {RequestMethod.POST})
	public DataResponse queryTipList(@RequestBody TipMessageListQueryReq req) {
		log.info("===========queryTipList提示信息列表接口请求报文："+JSONObject.toJSON(req).toString());
		//调用service
		DataResponse res = tipMessageService.queryTipList(req);
		log.info("===========saveCollect提示信息列表接口返回报文："+JSONObject.toJSON(res).toString());
		return res;
	}
	
	/**
	 * @description 提示信息保存接口 
	 * @author saizhiyi 
	 * @param req
	 * @return
	 */
	@RequestMapping(value="/TipSave", method= {RequestMethod.POST})
	public DataResponse tipSave(@RequestBody TipSaveReq req) {
		log.info("===========TipSave提示信息保存接口请求报文："+JSONObject.toJSON(req).toString());
		//调用service
		DataResponse res = tipMessageService.tipSave(req);
		log.info("===========TipSave提示信息保存接口返回报文："+JSONObject.toJSON(res).toString());
		return res;
	}
	
	/**
	 * @description 提示信息详情查看接口 
	 * @author saizhiyi 
	 * @param req
	 * @return
	 */
	@RequestMapping(value="/TipQuery", method= {RequestMethod.POST})
	public DataResponse tipQuery(@RequestBody TipQueryReq req) {
		log.info("===========TipQuery提示信息详情接口请求报文："+JSONObject.toJSON(req).toString());
		//调用service
		DataResponse res = tipMessageService.tipQuery(req);
		log.info("===========TipQuery提示信息详情接口返回报文："+JSONObject.toJSON(res).toString());
		return res;
	}
	
	/**
	 * @description 提示信息修改接口 
	 * @author saizhiyi 
	 * @param req
	 * @return
	 */
	@RequestMapping(value="/TipUpdate", method= {RequestMethod.POST})
	public DataResponse tipUpdate(@RequestBody TipUpdateReq req) {
		log.info("===========TipUpdate提示信息修改接口请求报文："+JSONObject.toJSON(req).toString());
		//调用service
		DataResponse res = tipMessageService.tipUpdate(req);
		log.info("===========TipUpdate提示信息修改接口返回报文："+JSONObject.toJSON(res).toString());
		return res;
	}

}
